package com.zys.exercise;

import java.util.ArrayList;

public class text3 {
    public static void main(String[] args) {
        ArrayList<Integer> al = new ArrayList<>();
        al.add(1);
        al.add(2);
        al.add(3);
        al.add(4);
        presentArry(al);

    }

    public static void presentArry(ArrayList<Integer> al) {
        for (int i = 0; i < al.size(); i++) {
            if(i==0)
            {
                System.out.print("[");
            }
            System.out.print(al.get(i));
            if(i<al.size()-1){
                System.out.print(",");
            }
            if(i==al.size()-1){
                System.out.print("]");
            }
        }

    }
}
